﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class StringTool : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string a = TextBox1.Text.Trim();
        while (a.Contains("  "))
            a = a.Replace("  ", " ");
        if (CheckBox1.Checked)
            a = a.Replace(" ", "");
        if (CheckBox2.Checked)
            a = a.Replace("\r\n", "");
        if (CheckBox3.Checked)
            a = a.Replace("\t", "");
        if (CheckBox4.Checked)
            a = a.Replace("\"", "'");
        if (CheckBox5.Checked)
            a = a.Replace("> <", "><");

        TextBox2.Text = a;
        Button1.Text = string.Format("{0}/{1} - ({2})", a.Length.ToString(), TextBox2.Text.Length.ToString(), (100-(TextBox2.Text.Length*1.0 / a.Length)*100.0).ToString());
    }
}